//
//  ImgBrowseController.m
//  SalonManage
//
//  Created by wulongmin on 17/6/3.
//  Copyright © 2017年 lmtt. All rights reserved.
//

#import "ImgBrowseController.h"
#import "LMSlideTab.h"
#import "SDCycleScrollView.h"

@interface ImgBrowseController ()<LMSlideTabDelegate>

@property(nonatomic, strong) LMSlideTab *slideTab;
@property(nonatomic, strong) SDCycleScrollView *scrollView;

@end

@implementation ImgBrowseController

#pragma mark - LifeCycle

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"服务项目";
}
#pragma mark - Event
#pragma mark - Public
#pragma mark - Private
#pragma mark - 布局协议

- (void)lm_getNewData {
    
    self.scrollView.imageURLStringsGroup = @[@"https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1497096104&di=4a0cb2d848ecb631394e2aca961bf40d&imgtype=jpg&er=1&src=http%3A%2F%2Fpic17.nipic.com%2F20111120%2F4836586_112653927000_2.jpg",
                                             @"https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1497096121&di=8c7334591f0cb47c5ad3142f0685cc33&imgtype=jpg&er=1&src=http%3A%2F%2Fpic11.photophoto.cn%2F20090616%2F0017030248491473_b.jpg",
                                             @"https://timgsa.baidu.com/timg?image&quality=80&size=b10000_10000&sec=1496491322&di=d04043d2d00d91a545999c954f554378&src=http://pic3.nipic.com/20090616/2000548_200841007_2.jpg"];
    
}

- (void)lm_layoutSubviews {
    
    self.slideTab.height = 44;
    self.slideTab.width = self.view.width;
    self.slideTab.bottom = self.view.bottom;
    
    self.scrollView.width = self.view.width;
    self.scrollView.height = self.slideTab.top - self.navigationBar.bottom;
    self.scrollView.top = self.navigationBar.bottom;
    
}

- (void)lm_addSubviews {
    [self.view addSubview:self.slideTab];
    [self.view addSubview:self.scrollView];
}

#pragma mark - 数据源和代理方法
#pragma mark LMSlideTabDelegate
- (void)slideTab:(LMSlideTab *)slideTab didSelectIndex:(NSInteger)index {
    
    NSLog(@"%zd",index);
    self.scrollView.imageURLStringsGroup = @[@"https://timgsa.baidu.com/timg?image&quality=80&size=b10000_10000&sec=1496491322&di=a307269a7274d2e83851a137719f1d83&src=http://pic12.nipic.com/20110107/2735936_084445004336_2.jpg",
                                             @"https://timgsa.baidu.com/timg?image&quality=80&size=b10000_10000&sec=1496491322&di=801b94682ddc5f01207f7d039a2d47c8&src=http://pic14.nipic.com/20110426/6762170_142623488000_2.jpg",
                                             @"https://timgsa.baidu.com/timg?image&quality=80&size=b10000_10000&sec=1496491322&di=3b92732b57fad8eb08f8c7fc4eec3e48&src=http://pic33.nipic.com/20130908/10008440_091243355174_2.jpg"];
}

#pragma mark - Settter & Getter

- (LMSlideTab *)slideTab {
    if (_slideTab == nil) {
        _slideTab = [[LMSlideTab alloc] init];
        _slideTab.delegate = self;
        _slideTab.titleArr = @[@"洗头",@"理发",@"烫染",@"洗头",@"理发",@"烫染",@"洗头",@"理发",@"烫染",@"洗头",@"理发",@"烫染"];
        _slideTab.titleFont = _kFontMain;
        _slideTab.selectColor = kRGBACOLOR(122, 144, 220, 0.3);
        _slideTab.titleColor = [UIColor blackColor];
    }
    return _slideTab;
}

- (SDCycleScrollView *)scrollView {
    if (_scrollView == nil) {
        _scrollView = [[SDCycleScrollView alloc] init];
        _scrollView.autoScroll = NO;
    }
    return _scrollView;
}

@end
